﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EndSign.aspx.cs" Inherits="JavascriptTest.EndSign" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>一些javascript语法容易出错的地方</title>
    <script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
    <style type="text/css">
        .style1
        {
            color: #FF0000;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="test1">
            <span style="color: Blue">function </span>test(){<br />
            &nbsp;&nbsp;&nbsp; return 1<br />
            &nbsp;&nbsp;&nbsp; +2<br />
            }<br />
            alert(test())<br />
            <a href="#" onclick="showResult1()">点击</a>显示运行结果:<span id="result1" style="color: red"></span>
            <script type="text/javascript">
                function test() {
                    return 1
                + 2
                }
                function showResult1() {
                    var re = test();
                    $("#result1").text(re);
                }
            </script>
        </div>
        <br />
        <br />
        <div id="test2">
            <span style="color: Blue">function </span>test(){<br />
            &nbsp;&nbsp;&nbsp; return 1<br />
            &nbsp;&nbsp;&nbsp; 2<br />
            }<br />
            alert(test())<br />
            <a href="#" onclick="showResult2()">点击</a>显示运行结果:<span id="result2" style="color: red"></span>
            <script type="text/javascript">
                function test1() {
                    return 1
                    2
                }
                function showResult2() {
                    var re = test1();
                    $("#result2").text(re);
                }
            </script>
            <br />
        </div>
        <br />
        <br />
        <div id="test3">
            <span style="color: Blue">function </span>test(){<br />
            &nbsp;&nbsp;&nbsp; return
            <br />
            &nbsp;&nbsp;&nbsp; 2<br />
            }<br />
            alert(test())<br />
            <a href="#" onclick="showResult3()">点击</a>显示运行结果:<span id="result3" style="color: red"></span>
            <script type="text/javascript">
                function test3() {
                    return
                    2
                }
                function showResult3() {
                    var re = test3();
                    $("#result3").text("re==undefined is " + (re == undefined));
                }
            </script>
            <br />
        </div>
        <br />
        <br />
        <div id="test4">
            <span style="color: Blue">function </span>test(){<br />
            &nbsp;&nbsp;&nbsp; 1
            <br />
            &nbsp;&nbsp;&nbsp; +2-<br />
            &nbsp;&nbsp;&nbsp; 3<br />
            }<br />
            alert(test())<br />
            <a href="#" onclick="showResult4()">点击</a>显示运行结果:<span id="result4" style="color: red"></span>
            <script type="text/javascript">
                function test4() {
                    1
                     + 2 -
                     3
                }
                function showResult4() {
                    var re = test4();
                    $("#result4").text("re==undefined is " + (re == undefined));
                }
            </script>
            <br />
        </div>
        <br />
        <br />
        <div id="test5">
            <span style="color: Blue">function </span>test(){<br />
            &nbsp;&nbsp;&nbsp;try{<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 1;<br />
            &nbsp;&nbsp;&nbsp; }<br />
            &nbsp;&nbsp;&nbsp; finally{<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return2;<br />
            &nbsp;&nbsp;&nbsp; }<br />
            }<br />
            alert(test())<br />
            <a href="#" onclick="showResult5()">点击</a>显示运行结果:<span id="result5" style="color: red"></span>
            <script type="text/javascript">
                function test5() {
                    try {
                        return 1;
                    }
                    finally {
                        return 2;
                    }
                }
                function showResult5() {
                    var re = test5();
                    $("#result5").text(re);
                }
            </script>
            <br />
        </div>
        <br />
        <br />
        <div id="test6">
            alert(Number());<br />
            <a href="#" onclick="showResult6()">点击</a>显示运行结果:<span id="Span1" style="color: red"></span>
            <script type="text/javascript">
                function showResult6() {
                    var re = Number();
                    $("#Span1").text(re);
                }
            </script>
            <br />
        </div>
        <span class="style1">说明:</span>在没有出现分号的情况下，多少行都是一条语句</div>
    </form>
</body>
</html>
